package sng.modules.view.components.city.state
{
	import sng.modules.view.components.city.cursor.CityCursor;
	import sng.modules.view.components.city.cursor.CityCursorManager;
	import sng.modules.view.components.city.logic.City;
	import sng.utils.BuildingUtil;

	/**
	 * 城市播种状态
	 * @author kelvinni
	 * 
	 */	
	public class CitySeedState implements ICityState
	{
		public var city:City;
		
		public function CitySeedState(_city:City)
		{
			city=_city;
			//更改指针状态 eason 20110715
			CityCursorManager.getInstance().setCursor(CityCursor.APPLE_CURSOR);
		}
		
		public function Execute(parameter:*=null):void
		{
			//播种操作
			if (city.currentBuilding.vo.buildingTypeId==BuildingUtil.FARM_TYPE)//只有家农田能接受播种
				if (city.currentBuilding.currentState.getiStateType()==EnumBuildState.SUPPLYGOODS_STATE)
					city.currentBuilding.seed();
		}
		
		public function toString():String
		{
			return "CitySeedState";
		}
	}
}